package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ApplyRecordMapper;
import com.ruoyi.system.domain.ApplyRecord;
import com.ruoyi.system.service.IApplyRecordService;

/**
 * 申报记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-24
 */
@Service
public class ApplyRecordServiceImpl implements IApplyRecordService 
{
    @Autowired
    private ApplyRecordMapper applyRecordMapper;

    /**
     * 查询申报记录
     * 
     * @param id 申报记录主键
     * @return 申报记录
     */
    @Override
    public ApplyRecord selectApplyRecordById(Long id)
    {
        return applyRecordMapper.selectApplyRecordById(id);
    }

    /**
     * 查询申报记录列表
     * 
     * @param applyRecord 申报记录
     * @return 申报记录
     */
    @Override
    public List<ApplyRecord> selectApplyRecordList(ApplyRecord applyRecord)
    {
        return applyRecordMapper.selectApplyRecordList(applyRecord);
    }

    /**
     * 新增申报记录
     * 
     * @param applyRecord 申报记录
     * @return 结果
     */
    @Override
    public int insertApplyRecord(ApplyRecord applyRecord)
    {
        applyRecord.setCreateTime(DateUtils.getNowDate());
        return applyRecordMapper.insertApplyRecord(applyRecord);
    }

    /**
     * 修改申报记录
     * 
     * @param applyRecord 申报记录
     * @return 结果
     */
    @Override
    public int updateApplyRecord(ApplyRecord applyRecord)
    {
        applyRecord.setUpdateTime(DateUtils.getNowDate());
        return applyRecordMapper.updateApplyRecord(applyRecord);
    }

    /**
     * 批量删除申报记录
     * 
     * @param ids 需要删除的申报记录主键
     * @return 结果
     */
    @Override
    public int deleteApplyRecordByIds(Long[] ids)
    {
        return applyRecordMapper.deleteApplyRecordByIds(ids);
    }

    /**
     * 删除申报记录信息
     * 
     * @param id 申报记录主键
     * @return 结果
     */
    @Override
    public int deleteApplyRecordById(Long id)
    {
        return applyRecordMapper.deleteApplyRecordById(id);
    }
}
